#include<iostream>
#include<algorithm>
using namespace std;
const int N = 110;
int arr[N][N];
bool st[N];
int n, m;
int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			char a;
			cin >> a;
			arr[i][j] = a - '0';
		}
		//cout << endl;
		getchar();
	}
	for (int i = 1; i <= m; i++) {
		int ma = arr[1][i];
		for (int j = 1; j <= n; j++) {
			ma = max(ma, arr[j][i]);
		}
		for (int j = 1; j <= n; j++) {
			if (ma == arr[j][i]) {
				st[j] = 1;
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (st[i]) {
			ans++;
			//cout << i << " ";
		}
	}
	cout << ans << endl;
	return 0;
}